<!DOCTYPE html>
<html>
<style>
	.layui-btn {
		display: inline-block;
		height: 38px;
		line-height: 38px;
		padding: 0 18px;
		background-color: #E52D2D !important;
		color: #fff;
		white-space: nowrap;
		text-align: center;
		font-size: 14px;
		border: none;
		border-radius: 2px;
		cursor: pointer;
	}
</style>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
	<title>商品详情</title>
	<script src="/static/mobile/js/mui.min.js"></script>
	<link href="/static/mobile/css/mui.min.css" rel="stylesheet"/>
	<link rel="stylesheet" type="text/css" href="/static/mobile/css/basic.css"/>
	<link rel="stylesheet" type="text/css" href="/static/mobile/css/produst_go.css"/>
	<link rel="stylesheet" type="text/css" href="/static/mobile/css/swiper.min.css"/>
	<link rel="stylesheet" href="/static/plugins/layui/css/layui.css" media="all" />
	<link rel="stylesheet" href="/static/admin/css/global.css" media="all">
	<link rel="stylesheet" href="/static/common/css/font.css" media="all">

	<script type="text/javascript" src="/static/mobile/js/jquery.js"></script>
	<script src="/static/mobile/js/swiper.min.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript" charset="utf-8">
		mui.init();
	</script>
</head>
<body>
<div class="sectionx">
	<header class="mui-bar mui-bar-nav" >
		<a class="mui-icon mui-icon-left-nav mui-pull-left" href="javascript:history.back(-1)" style="color: #4E4E4E;"></a>
		<h1 class="mui-title">商品详情</h1>
		<!--<a class="mui-icon mui-pull-right right1" href="javascript:;"><img src="images/nav_icon_share_w.png"/></a>-->
	</header>
</div>
<div class="section2">
	<div class="swiper-container">
		<div class="swiper-wrapper">
			{$info.pics|picshow}


		</div>

		<div class="swiper-pagination"></div>
	</div>
</div>

<div class="section3">
	<div class="container">
		<p class="p1">{$info.title}</p>
		<p class="p2"><span class="s1">¥ {$info.jiage}</span><span class="s2">¥ {$info.price}</span></p>
	</div>
</div>
<div class="ge"></div>
<div class="section4">
	<div class="container">
		<div class="section4-1">
			<p class="p1">商品详情</p>
		</div>
		<div class="section4-2">
			{$info.content|raw}
		</div>
	</div>
</div>



<div class="kong1"></div>
<div class="layui-form">
	<div class="gouwu" >
		<div class="che">
			<a href="{:url('user/shop/listbuy')}">
				<img src="/static/mobile/images/b1.png"/>
				<p>购物车</p>
				<!--<span class="sss">{$shopzong}</span>--->
			</a>
		</div>
		<input type="hidden" name="shopid" value="{$info.id}">
		<input type="hidden" name="dizhi" id="dizhi" value="{$user.dizhi}">
		<div class="jia">
			<a data={$info.id} id='buycar'  lay-filter="sub" lay-submit>加入购物车</a>
		</div>
		<div class="mai">
<!--			<a href="{:url('user/shop/buy',array('id'=>$info['id']))}">立即购买</a>-->
			<button  class="layui-btn" onclick="return isdizhi('{$info.id}');"   >立即购买</button>
		</div>
	</div>
</div>
</body>
<script src="/static/plugins/layui/layui.js"></script>
<script>
	layui.use(['form', 'layer'], function () {
		var form = layui.form,$ = layui.jquery;
		// 登录提交监听
		form.on('submit(sub)', function (data) {
			var loading = layer.load(1, {shade: [0.1, '#fff']});
			$.post("{:url('user/shop/buycar')}",data.field,function(res){
				layer.close(loading);
				if(res.code==1){
					layer.msg(res.msg,{time:1000,icon:1},function(){
						window.location.href = res.url;
					});
				}else{
					layer.msg(res.msg,{time:1000,icon:2});
					// $('.captcha img').attr('src','{:url("verify")}?id='+Math.random());
				}
			});
		})
	})

	function isdizhi(id) {
		var dizhi=$("#dizhi").val();
		if(dizhi==""){
			layer.msg("请先完成详情地址",{time:1000,icon:2},function(){
				window.location.href = "{:url('user/set/mybank')}";
			});
		}else{
			window.location.href = "{:url('user/shop/buy')}?id="+id;
		}
	}
</script>
<script>
	var swiper = new Swiper('.swiper-container', {
		spaceBetween: 30,
		centeredSlides: true,
		autoplay: {
			delay: 2000,
			disableOnInteraction: false,
		},
		pagination: {
			el: '.swiper-pagination',
			clickable: true,
		},
	});
</script>
</html>